setwd("E:/5hmc_file/2_5hmc_yjp_bam/ASM/20201230.GO.enrich")
file=read.csv("807psyASH.associated.gene.toppgene..txt",head=T,sep="\t")
unique(file$Category)
library(ggplot2)

file1=file[file$Category=="GO: Cellular Component",]
file1$num=dim(file1)[1]:1
file1=data.frame(file1$Name,file1$q.value.FDR.B.H,file1$Hit.Count.in.Query.List,file1$num)
names(file1)=c("name","FDR","counts","num")
ggplot(file1,aes(FDR,num))+geom_point(aes(size=counts,color=FDR))+
  scale_color_gradient(low = "#E64B35", high = "#3C5488")+
  scale_y_continuous(breaks = file1$num,labels = file1$name)+
  scale_x_continuous(limits=c(0, 0.1), breaks=seq(0, 0.1, 0.02))+theme_light(base_size = 15)+
  theme(panel.grid.minor = element_blank())

file1=file[file$Category=="GO: Molecular Function",]
file1$num=dim(file1)[1]:1
file1=data.frame(file1$Name,file1$q.value.FDR.B.H,file1$Hit.Count.in.Query.List,file1$num)
names(file1)=c("name","FDR","counts","num")
ggplot(file1,aes(FDR,num))+geom_point(aes(size=counts,color=FDR))+
  scale_color_gradient(low = "#E64B35", high = "#3C5488")+
  scale_y_continuous(breaks = file1$num,labels = file1$name)+
  scale_x_continuous(limits=c(0, 0.1), breaks=seq(0, 0.1, 0.02))+theme_light(base_size = 15)+
  theme(panel.grid.minor = element_blank())

file1=file[file$Category=="GO: Biological Process",][c(1:3,6,11,18,21),]
file1$num=dim(file1)[1]:1
file1=data.frame(file1$Name,file1$q.value.Bonferroni,file1$Hit.Count.in.Query.List,file1$num)
names(file1)=c("name","FDR","counts","num")
ggplot(file1,aes(FDR,num))+geom_point(aes(size=counts,color=FDR))+
  scale_color_gradient(low = "#E64B35", high = "#3C5488")+
  scale_y_continuous(breaks = file1$num,labels = file1$name)+
  theme_light(base_size = 15)+
  theme(panel.grid.minor = element_blank())
